<div class="home_galerias">
	<div class="title-bar">
		<span></span>
		<h2>GALERÍA </h2>
	</div>

    <div class="main-image">
	<h3><?=$galerias[0]->title?></h3> 
<div style="display:none;">
<?php print_r($galerias[0]); ?>
</div>
        <div class="image-title"></div>
	
		<div class="image">
			<a href="./articulo/galeria/<?=$galerias[0]->id?>/<?=$galerias[0]->gallery[0]->path?>/625" rel="lightbox[roadtrip]" title="<?=$galerias[0]->title?>">
				<img src="./articulo/galeria/<?=$galerias[0]->id?>/<?=$galerias[0]->gallery[0]->path?>/625x312" />
			</a>
		</div>
     </div>

    <div class="thumbs">
    	<img src="img/carrusel/arrow-prev.png" id="prev" />
        <img src="img/carrusel/arrow-next.png" id="next" />
		<div class="thumbs-scroll">
		    <ul>
			<?
			$c = 0;
			foreach($galerias[0]->gallery as $image){
				
			?>
			<a style="display: none" href="./articulo/galeria/<?=$galerias[0]->id?>/<?=$image->path?>/625" rel="lightbox[roadtrip]" title="<?=$galerias[0]->title?>">
			</a>
			
			<li class="<?=($c==0) ? "selected": ""?>" article_id="<?=$galerias[0]->id?>" title="<?=$galerias[0]->title?>" image="<?=$image->path?>">
				<img src="./articulo/galeria/<?=$galerias[0]->id?>/<?=$image->path?>/90x60" />
			</li>
			<?
			$c++;
			}
			?>
		    </ul>
		</div>
    </div>


	
</div>

<script type="text/javascript">	
	head.ready(function() {
		
		(function(){
			

			
			$(".home_galerias .thumbs .thumbs-scroll").jCarouselLite({
			    visible: 6,
			    btnNext: ".home_galerias #next",
			    btnPrev: ".home_galerias #prev"
			});
			
			$(".home_galerias .thumbs .thumbs-scroll li").click(function() {
				var me 		= $(this);
				$(".home_galerias .thumbs .thumbs-scroll li").removeClass("selected");
				me.addClass("selected");
				
				var article_id 	= me.attr("article_id");
				var image 	= me.attr("image");
				
				var main = me.closest(".home_galerias").find(".main-image");

				main.find(".image img").attr("src","./articulo/galeria/"+article_id+"/"+image+"/625x312");
				main.find("a").attr("href","./articulo/galeria/"+article_id+"/"+image+"/625");

			});
		})();

	});
</script>
